<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <!-- 
        get    获取数据
        post   添加数据
        put    修改数据
        delete 删除数据
     -->
    <script src="/js/jquery.min.js"></script>
    <script>
        //  获取用户信息
        $.ajax({
            type: 'get',
            url: '/users',
            success: function(response) {
                console.log(response);
            }
        });
        //  获取id为1用户信息
        $.ajax({
            type: 'get',
            url: '/users/1',
            success: function(response) {
                console.log(response);
            }
        });
        //  修改用户信息
        $.ajax({
            type: 'put',
            url: '/users/1',
            success: function(response) {
                console.log(response);
            }
        });
        //  获取用户信息
        $.ajax({
            type: 'delete',
            url: '/users/1',
            success: function(response) {
                console.log(response);
            }
        });
    </script>
</body>

</html>